home *** CD-ROM | disk | FTP | other *** search
/ Georgia Wildfire Prevention / Georgia Wildfire Prevention.iso / pc / media / dirs / BackUp / GoodBad.dir / 00035_Script_Ending < prev    next >
Text File  |  2002-10-15  |  2KB  |  53 lines

  1. --ENDING--
  2. --Attach this behavior to a sprite to make it flash and play a sound when a movie or sound channel is empty.
  3.  
  4. property SpNum, Flashing, PlaySound, SoundChannel, MovieCheck, Quename, QueSprite, guard, soundguard
  5.  
  6. on new me
  7.   SpNum = me.spritenum
  8.   guard = 0
  9.   soundguard = 0
  10. end
  11.  
  12. on getPropertyDescriptionList me
  13.   set pList = [\
  14.   #Flashing : [#comment: "What member would you like to use as the hot state (FilmLoop)?", #format:#filmloop, #default: ""],\
  15.   #PlaySound: [#comment: "Which sound would you like to play?", #format:#sound, #default: ""],\
  16.   #SoundChannel : [#comment: "Wait for sound channel to empty before begining?", #format:#string, #range: ["No", "Channel 1", "Channel 2", "All Channels"], #default: 0],\
  17.   #Moviecheck : [#comment: "Wait for a movie to finish before beginning? ", #format:#boolean, #default: 0],\
  18.   #QueName : [#comment: "If checked, what is the movie's member name? " & RETURN & "---Don't forget to attach the Ending2 behavior to the movie--", #format:#quicktimemedia, #default: ""]\
  19.   ]
  20.   return plist
  21. end
  22.  
  23. --Makes the sprite flash and the sound play.
  24. on Ending me
  25.   if guard = 0 then
  26.     QueSprite = sendallsprites (#IdCall)
  27.     guard = 1
  28.   end if
  29.   if (Moviecheck = 1) and (member(QueName).duration = sprite(QueSprite).movietime) then --If movie is over.
  30.     sprite(SpNum).membernum = member(Flashing).number
  31.     if soundguard = 0 then
  32.       sound(1).play(member(Playsound))
  33.       soundguard = 1
  34.     end if
  35.   else if SoundChannel <> "No" then --If the sound channel is empty.
  36.     if (SoundChannel = "Channel 1" and soundbusy(1) = 0) or (SoundChannel = "Channel 2" and soundbusy(2) = 0) or (SoundChannel = "All Channels" and soundbusy() = 0) then
  37.       sprite(SpNum).membernum = member(Flashing).number
  38.       if soundguard = 0 then
  39.         sound(1).play(member(Playsound))
  40.         soundguard = 1
  41.       end if
  42.     end if
  43.   end if
  44. end
  45.  
  46.  
  47.  
  48.  
  49.  
  50.  
  51.  
  52.  
  53.